﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Resources;
using System.Web;
using System.Web.Services;

namespace smasb2b
{
    /// <summary>
    ///GetMessageID 的摘要描述
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允許使用 ASP.NET AJAX 從指令碼呼叫此 Web 服務，請取消註解下列一行。
    [System.Web.Script.Services.ScriptService]
    public class GetMessageID : System.Web.Services.WebService 
    {

        [WebMethod]
        public string GetLanguageMessage(string MSGID)
        {
            //ResourceManager rm = new ResourceManager(
            //    System.Convert.ToString(
            //    "smasb2b." + System.Convert.ToString(Session["langauage"])), System.Reflection.Assembly.GetExecutingAssembly());

            ResourceManager rm = new ResourceManager(
               System.Convert.ToString(
               "smasb2b." + System.Convert.ToString("zh-TW")), System.Reflection.Assembly.GetExecutingAssembly());


            string ReturnValue = "";
            try
            {
                ReturnValue = rm.GetString(MSGID);
            }
            catch (Exception)
            {
                ReturnValue = "error";
            }

            return ReturnValue;
        }
    }
}
